// 模型更改插件

string author = "Live";
string pluginName = "Zombie_Settings 僵尸设置";
string version = "1.0";

bool zombie_run = false;
int gamemode = 0;

// 当插件被初始化
void OnPluginInit()
{
        // 设置插件信息
        PluginData::SetAuthor(author);
        PluginData::SetName(pluginName);
        PluginData::SetVersion(version);

        // 提示
        ThePresident.InfoFeed("插件:"+pluginName+"| 版本:"+version+"| 作者:"+author,false);
        
        // 当生成僵尸时
        Events::Infected::OnInfectedSpawned.Hook( @OnInfectedSpawned );
}

void ThePresident_OnMapStart(){
        // 获取游戏模式
        gamemode = ThePresident.GetGameModeType();
}

// 当生成僵尸后
HookReturnCode OnInfectedSpawned(Infected@ pInfected)
{
	if ( pInfected is null ) return HOOK_HANDLED;
        // 如果不带防爆头盔
        if (not pInfected.HasRiotHelmet()){
                // 套个南瓜头 
	        Utils.CosmeticWear( pInfected, "models/halloween/w_head_pumpkin.mdl" );
        }
        // 经典，全跑
        if( gamemode == CT_OBJECTIVE ){
                pInfected.SetAnimationSet(10);
        }
        return HOOK_CONTINUE;
}